package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "sms", schema = "", catalog = "onedollar")
public class SmsEntity {
    private int id;
    private String content;
    private Timestamp createtime;
    private String mobile;
    private Integer status;
    private Integer falureCount;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "content", nullable = true, insertable = true, updatable = true, length = 200)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "createtime", nullable = true, insertable = true, updatable = true)
    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "mobile", nullable = true, insertable = true, updatable = true, length = 20)
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "status", nullable = true, insertable = true, updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "falure_count", nullable = true, insertable = true, updatable = true)
    public Integer getFalureCount() {
        return falureCount;
    }

    public void setFalureCount(Integer falureCount) {
        this.falureCount = falureCount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SmsEntity smsEntity = (SmsEntity) o;

        if (id != smsEntity.id) return false;
        if (content != null ? !content.equals(smsEntity.content) : smsEntity.content != null) return false;
        if (createtime != null ? !createtime.equals(smsEntity.createtime) : smsEntity.createtime != null) return false;
        if (mobile != null ? !mobile.equals(smsEntity.mobile) : smsEntity.mobile != null) return false;
        if (status != null ? !status.equals(smsEntity.status) : smsEntity.status != null) return false;
        if (falureCount != null ? !falureCount.equals(smsEntity.falureCount) : smsEntity.falureCount != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        result = 31 * result + (mobile != null ? mobile.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (falureCount != null ? falureCount.hashCode() : 0);
        return result;
    }
}
